using System.Collections.Generic;

namespace Pay.Core.AlipayWap {
	public class PayWap {
		/// <summary>
		/// 1、开发文档中心（https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.2Z6TSk&treeId=60&articleId=103693&docType=1）
		/// 2、商户帮助中心（https://cshall.alipay.com/enterprise/help_detail.htm?help_id=473888）
		/// 3、支持中心（https://support.open.alipay.com/alipay/support/index.htm）
		/// </summary>
		/// <param name="payment_query"></param>
		/// <param name="body"></param>
		/// <param name="pay_no"></param>
		/// <param name="total_fee"></param>
		/// <param name="notify_url"></param>
		/// <param name="return_url"></param>
		/// <param name="show_url">商品展示网址</param>
		/// <returns></returns>
		public static string GetRequestUrl(payment_query payment_query, string body, string pay_no, decimal total_fee,
			string notify_url, string return_url, string show_url) {
			SortedDictionary<string, string> sParaTemp = new SortedDictionary<string, string>();
			sParaTemp.Add("partner", payment_query.app_id);
			sParaTemp.Add("seller_id", payment_query.mchid);
			sParaTemp.Add("_input_charset", "utf-8");
			sParaTemp.Add("service", "alipay.wap.create.direct.pay.by.user");
			sParaTemp.Add("payment_type", "1");
			sParaTemp.Add("notify_url", notify_url);
			sParaTemp.Add("return_url", return_url);
			sParaTemp.Add("out_trade_no", pay_no);
			sParaTemp.Add("subject", body);
			sParaTemp.Add("total_fee", total_fee.ToString());
			sParaTemp.Add("show_url", show_url);
			sParaTemp.Add("body", "");
			string sHtmlText = new Submit(payment_query).BuildRequest(sParaTemp);
			return sHtmlText;
		}
	}
}
